<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/bootstrap-responsive.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/style.css">
    <link type="text/css" href="__PUBLIC__/Admin/css/b5m-plugin.css" rel="stylesheet">
    <link type="text/css" href="__PUBLIC__/Admin/css/b5m.css" rel="stylesheet">
    <style type="text/css">
      #bg{width:100%;height:100%;top:0px;left:0px;position:absolute;filter: Alpha(opacity=50);opacity:0; background:#000000; display:none;}
       #popbox{position:absolute;width:200px; height:200px; left:55%; top:60%; margin:-200px 0 0 -200px; display:none;}
    </style>
</head>
<body>
  	 <table class="table table-bordered table-hover definewidth m10">
  		<tbody>
  		<tr>
    	  <td width="100px">组员管理：</td> 
    	  <td style="text-align:left;">
    	  <select name="" id="userId">
             <option selected="selected" value="-1">请选择成员</option>
             <volist name='user' id='r'>
                <option value="{$r.userid}">{$r.username}</option>
             </volist>
          </select>
          <select name="status.sid" id="statusId">
             <option selected="selected" value="-1">全部资源状态</option>
               <option value="1">申请未通过</option>
               <option value="2">已通过</option>
               <option value="3">意向客户</option>
               <option value="4">已入金</option>
               <option value="5">非微信号码</option>
          </select>
          <input value="查询" class="btn btn-primary" onclick="findResources()" type="button"></td>	
    	</tr>
    	<tr>
    	   <td width="100px">删除员工：</td>
    	    <td><input placeholder="请输入员工的登录帐号" id="deletegroupid">&nbsp;&nbsp;&nbsp;
    	       <input value="删除员工" onclick="deleteGroupMember()" class="btn btn-primary" type="button">
    	    </td>
    	 </tr>
   </tbody>
  </table>
   <a href="#" onclick="pupopen()"></a>
       <div id="bg"></div>
       <div id="popbox">
          <img src="__PUBLIC__/Admin/images/loading.gif">
          <a href="#"  onclick="pupclose()"></a>
      </div>
</body>
 <script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.js"></script>
 <script src="__PUBLIC__/Admin/js/b5m.js" charset="utf-8" id="b5mmain" type="text/javascript"></script>
    <!--<script type="text/javascript" src="Js/jquery.sorted.js"></script>-->
    <script type="text/javascript" src="__PUBLIC__/Admin/js/bootstrap.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/js/ckform.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/js/common.js"></script>
    <script type="text/javascript">
     function pupopen(){
          document.getElementById("bg").style.display="block";
          document.getElementById("popbox").style.display="block" ; 
    }

    function pupclose(){
          document.getElementById("bg").style.display="none";
          document.getElementById("popbox").style.display="none" ;  
    }
</script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }

    </style>
    <script type="text/javascript">
      
    function findResources(){
      var userid=$("#userId").val();
      var sid = $("#statusId").val();
      if(userid==-1){
        alert("请选择查询组员");
        return false;
      }
      window.location.href="guanLiZuYuan?userid="+userid+"&sid="+sid; 
    }
    function deleteGroupMember(){
      var loginname=$("#deletegroupid").val();
      if(loginname==""){
        alert("员工账号不能为空");
        return;
      }
      var run = confirm("是否删除员工帐号?");
      if(run){
            pupopen();
            $.ajax({
              type: 'POST',
              url: "{:U('Group/delYuanGong')}",
              data: {"loginname":loginname,},
              dataType : "json", 
              success: function(data) {
                 pupclose();
                 if(data.ok==1){
                      alert("删除成功");
                      $("#deletegroupid").val("");
                      window.location.reload();
                  }
                  if(data.ok==0){
                    alert('删除失败，没有此帐号！');
                    $("#deletegroupid").val("");
                  }
                  if(data.ok==2){
                    alert('删除失败，请找相关负责人！');
                    $("#deletegroupid").val("");
                  }
                }
              });
        }
    }
    </script>
</html>